<?php
/** $Id: default_form.php 11917 2009-05-29 19:37:05Z ian $ */
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!-- Top banner block-->

<div class="top_banner col2"><img src="<?php echo $this->baseurl ?>/templates/mwc/medias/images/banner_ydelser.jpg" alt="Kontakt os" /></div>
<!-- / End top banner block-->
<!-- Begin main content -->
<div id="main" class="ydelser">
  <!-- Begin product list  -->
  <div class="content_ctn col2">
    <h1 class="main_title"><span>Kontakt os</span></h1>
	<?php
		if(JRequest::getVar('success','0','get' )=='1'){
	?>
	<div id="kontaktContent">
       Kære kunde, Tak for din henvendelse! Vi vil kontakte dig hurtigst muligt.<br />
            Med venlig hilsen<br />
			My Web Creations <br />
		<a href="/"><img src="templates/mwc/images/backtohome.png"></a>
    </div>
	<?php
		}else{
	?>
    <div id="kontaktContent">
      <div class="col6 fl_left">
        <div class="box_decor_s4">
          <div class="top_decor"><span></span></div>
          <div class="middle_decor">
            <form action="<?php echo JRoute::_('index.php'); ?>" class="form-validate" method="post" name="contactForm" id="contactForm">
              <fieldset>
              <p class="desc">Du er altid velkommen til at kontakte os, hvis du ønsker mere information om vores virksomhed og produkter.</p>
              <label>Kontaktperson:</label>
              <input class="text required" type="text" name="person" id="person" value=""/>
              <label>Email:</label>
              <input class="text required email" type="text" name="email" id="email" value=""/>
              <label>Telefon:</label>
              <input class="text required" type="text" name="telephone" id="telephone" value=""/>
              <label>Firma/navn:</label>
              <input class="text required" type="text" name="name" id="name" value=""/>
              <label>Emne:</label>
              <input class="text required" type="text" name="subject" id="subject" value=""/>
              <label>Din besked:</label>
              <textarea rows="6" class="required" cols="10" id="message" name="message"></textarea>
              <div class="actions"> <a id="sendBtn" class="click_btn" href="javascript:void(0);" onclick="click_send();">Send</a> <a id="resetBtn" class="click_btn" href="javascript:void(0);" onclick="reset_form();">Nulstil</a> </div>
              </fieldset>
              <input type="submit" name="send" id="send" value="Send" style="display: none;" />
			  <input type="hidden" name="option" value="com_contact" />
			<input type="hidden" name="view" value="contact" />
			<input type="hidden" name="id" value="<?php echo $this->contact->id; ?>" />
			<input type="hidden" name="task" value="submit" />
			<input type="hidden" name="category_id" value="<?php echo JRequest::getVar('category_id', 0, 'get'); ?>" />
			<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid', 0, 'get'); ?>" />
			
              <?php echo JHTML::_( 'form.token' ); ?>
            </form>
          </div>
          <div class="bottom_decor"><span></span></div>
          <div class="forhand"><a class="forhand_btn" href="/">Til forsiden</a></div>
        </div>
      </div>
      <div class="col6 fl_right">
        <div class="box_decor_s4">
          <div class="top_decor"><span></span></div>
          <div class="middle_decor">
			<form action="<?php echo JRoute::_('index.php'); ?>" class="form-validate" method="post" name="orderForm" id="orderForm">
              <fieldset>
              <div class="col7 fl_left"> <span class="gradient_txt">Bestil information</span>
                <p class="desc">Jeg ønsker at vide mere om:</p>
                <input class="checkbox" type="checkbox" checked="checked" name="website"/>
                <label>Hjemmeside</label>
                <input class="checkbox" type="checkbox" checked="checked" name="webshop"/>
                <label>Webshop</label>
                <input class="checkbox" type="checkbox" checked="checked" name="optimering"/>
                <label>Søgemaskineoptimering</label>
              </div>
              <div class="col8 fl_right">
                <input class="text required" type="text" name="name" id="name" value="Indtast dit navn"/>
                <input class="text required" type="text" name="telephone" id="telephone" value="Indtast dit telefonnr."/>
                <input class="text required email" type="text" name="email1" id="email1" value="Indtast din email"/>
                <input class="text required" type="text" name="posttext" id="posttext" value="Indtast din postnr."/>
                <select name="hear">
                  <option selected="selected" value="0">Hvor har du hørt om os?</option>
                  <option value="Aviser">Aviser</option>
                  <option value="TV">TV</option>
                  <option value="Reklame">Reklame</option>
                  <option value="Internettet">Internettet</option>
                  <option value="Facebook">Facebook</option>
                  <option value="En ven">En ven</option>
                  <option value="Andet">Andet</option>
                </select>
                <div class="actions"><a id="orderSendBtn" class="click_btn" href="javascript:void(0);" onclick="click_sendorder();">Send</a></div>
              </div>
              </fieldset>
			   <input type="submit" name="send" id="sendorder" value="Send" style="display: none;" />
			  <input type="hidden" name="option" value="com_contact" />
			<input type="hidden" name="view" value="contact" />
			<input type="hidden" name="id" value="<?php echo $this->contact->id; ?>" />
			<input type="hidden" name="task" value="submitorder" />
			<input type="hidden" name="category_id" value="<?php echo JRequest::getVar('category_id', 0, 'get'); ?>" />
			<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid', 0, 'get'); ?>" />
			
              <?php echo JHTML::_( 'form.token' ); ?>
            </form>
          </div>
          <div class="bottom_decor"><span></span></div>
        </div>
        <div class="box_decor_s4 v_extra">
          <div class="top_decor"><span></span></div>
          <div class="middle_decor">
            <div class="contact_info">
              {module contactustext}
            </div>
          </div>
          <div class="bottom_decor"><span></span></div>
        </div>
      </div>
    </div>
  </div>
  <?php
  }//end if
  ?>
  <!-- /end product list  -->
</div>
<!-- / end main content -->
<script language="javascript">
jQuery(document).ready(function($) {	
	
	jQuery("#contactForm").validate({
		errorPlacement: function(error, element) {			
		},
		invalidHandler: function(form, validator) {
		  var errors = validator.numberOfInvalids();
		  if (errors) {
			jQuery('#alert').html(validator['errorList'][0]['message']);
			jQuery('#backoverlay').show();
			jQuery('#show_popup').show();
			jQuery('#f_focus').html(validator['errorList'][0]['element'].name);
			validator['errorList'][0]['element'].focus();
		  } else {
		  }
		},
		rules: {
			person : "required",
			email: {
				required: true,
				email: true
			},
			telephone: "required",
			name : "required",
			subject : "required",
			message : "required"
		},
		messages: {
			person: "Kontaktperson skal udfyldes!",
			email: "Email skal udfyldes!",
			telephone: "Telefon skal udfyldes!",
			name: "Firma/navn skal udfyldes!",
			subject: "Emne skal udfyldes!",
			message: "Din besked skal udfyldes!"
			
		}
	
	});
	jQuery("#orderForm").validate({
		
		errorPlacement: function(error, element) {			
		},
		invalidHandler: function(form, validator) {
		  var errors = validator.numberOfInvalids();
		  if (errors) {
		  	var value = validator['errorList'][0]['element'].value;
			jQuery('#alert').html(validator['errorList'][0]['message']);
			jQuery('#backoverlay').show();
			jQuery('#show_popup').show();
			jQuery('#f_focus').html(validator['errorList'][0]['element'].name);
			
			validator['errorList'][0]['element'].focus();
			validator['errorList'][0]['element'].value = value;
			
		  } else {
		  }
		},
		rules: {
			name : "required",
			telephone: "required",
			email1: {
				required: true,
				email: true
			},
			posttext : "required"

		},
		messages: {
			name: "Venligst navn skal udfylde",
			telephone: "Telefon skal udfyldes!",
			email1: "Indtast din email skal udfyldes!",
			posttext: "Subject required"
			
		}
	
	});
	close_popup=function(){		
		var fel=jQuery('#f_focus').html();
		jQuery('#backoverlay').hide();
		jQuery('#show_popup').hide();
		jQuery('#' + fel ).focus();
  };
  reset_form=function(){
		jQuery('#contactForm')[0].reset()
  };
  click_send=function(){
		document.getElementById('send').click();
  }
   click_sendorder=function(){
		document.getElementById('sendorder').click();
  }
});
			</script>
